package com.join.mybatis.config;

import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.join.mybatis.bean.MySqlInjector;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author chengang
 */
@Configuration
@ConditionalOnBean(MybatisPlusAutoConfiguration.class)
public class MybatisPlusJoinAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean(DefaultSqlInjector.class)
    public MySqlInjector mySqlInjector(){
        return new MySqlInjector();
    }
}
